import dataclasses
import datetime
from dataclasses import dataclass


@dataclass
class A:
    name: str
    age: int


@dataclass
class B:
    name: str
    age: int


a = A(name="caolu", age=20)
print(a)
print()
b = B(**dataclasses.asdict(a))
print(b)
